package com.ka.creator;

import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import android.content.Context;

import com.ka.model.GeneralModel;
import com.ka.provider.Type.DataType;

public class Creator {

	protected Context ct;
	protected static Creator self;

	protected Creator(Context context) {
		ct = context;
	}

	public static Creator createInstance(Context context, DataType type) {
		switch (type) {
		case MenuLeft:
			self = new CreatorMenuLeft(context);
			break;
		case User:
			self = new CreatorUser(context);
			break;
		default:
			self = new CreatorMenuLeft(context);
			break;
		}

		return self;
	}

	public void switchInstance(Creator creator) {
		self = creator;
	}

	public List<GeneralModel> createList(String str) {
		return self.createList(str);
	}

	public List<GeneralModel> createList(String[] str) {
		return self.createList(str);
	}

	public List<GeneralModel> createList(JSONObject json) {
		return self.createList(json);
	}

	public List<GeneralModel> createList(JSONArray json) {
		return self.createList(json);
	}

	public GeneralModel create(String str) {
		return self.create(str);
	}

	public GeneralModel create(String[] str) {
		return self.create(str);
	}

	public GeneralModel create(JSONObject json) {
		return self.create(json);
	}

}
